package pckg;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JPanel;

public class Simulator extends JPanel{

	private static final long serialVersionUID = 1L;
	private static int midX = 0;
	private static int midY = 0;
	public static final int scale = 80;
	
	public void paint(Graphics g){
		
		if (midX == 0){
			midX = (int) (getWidth()/2.0);
			midY = (int) (getHeight()/2.0);
		}
		
		g.setColor(Color.BLACK);
		g.drawLine(0, 0, getWidth()-1, 0);
		g.drawLine(getWidth()-1, 0, getWidth()-1, getHeight()-1);
		g.drawLine(getWidth()-1, getHeight()-1, 0, getHeight()-1);
		g.drawLine(0, getHeight()-1, 0, 0);
		
		g.setColor(new Color((float)0.75,(float)0.75,(float)0.75));
		g.drawLine(midX, 0, midX, getHeight());
		g.drawLine(0, midY, getWidth(), midY);
		
		
		RobotDrawer.draw(g, Main.getRobot(),Main.getNNvRobot(), 
							Main.getNNspRobot(), Main.getSurfRobot(), 
							Main.getDecRobot());
	}
	
	public static int getMidX(){
		return midX;
	}
	
	public static int getMidY(){
		return midY;
	}
	
}
